﻿package plugin.duanzao
{
    import com.core.*;
    import com.sh.game.util.*;
    import consts.*;
    import flash.events.*;
    import manager.*;
    import morn.core.components.*;
    import morn.core.handlers.*;
    import plugin.duanzao.view.*;
    import uiresource.*;
    import view.*;
    import view.mornExtends.*;
    import vo.*;

    public class DuanZaoUICtrl extends DuanZaoUI
    {
        private var _close:Function;
        private var onArr:Array;
        private var arr:Array;
        private var dataType:int = 0;
        private var objValue:Object;
        private var dataLv:int = 0;
        private var _tabArr:Array;
        private var mType:int = 0;
        public var _armArray:Array;
        public var _armOnArray:Array;
        private var curPage:int = 1;
        public var HC_TypeIndex:int;
        public var daoju_hechengView:HeChengView;
        public var jiandingView:JianDingView;
        public var qianghuaView:QiangHuaView;
        public var zhuanyiView:ZhuanYiView;
        public var viewArr:Array;
        private var Level:int;
        private var guideFlag:Boolean = false;
        private var _k:int = 0;
        private var PageNum:int = 6;
        private var zyPage:int = 1;
        private var beibaoPage:int = 0;
        private var chuanPage:int = 0;
        private var isChange:Boolean = false;
        private var oldChuan:Array;
        private var oldBeibao:Array;
        private var isChangeBag:Boolean = false;

        public function DuanZaoUICtrl(param1:Function)
        {
            this._tabArr = [];
            this._armArray = [];
            this._armOnArray = [];
            this.viewArr = [];
            this.oldChuan = [];
            this.oldBeibao = [];
            this._close = param1;
            return;
        }// end function

        override protected function createChildren() : void
        {
            viewClassMap["uiresource.HeChengUI"] = HeChengView;
            viewClassMap["uiresource.JianDingUI"] = JianDingView;
            viewClassMap["uiresource.QiangHuaUI"] = QiangHuaView;
            viewClassMap["uiresource.ZhuanYiUI"] = ZhuanYiView;
            loadUI("DuanZao.xml");
            this.daoju_hechengView = hechengUI as HeChengView;
            this.jiandingView = jiandingUI as JianDingView;
            this.qianghuaView = qianghuaUI as QiangHuaView;
            this.zhuanyiView = zhuanyiUI as ZhuanYiView;
            return;
        }// end function

        override protected function initializeView() : void
        {
            super.initializeView();
            var _loc_1:* = Control.create(QiangHuaControl, this);
            ModelProxy.addObserver("jianding", _loc_1);
            ModelProxy.addObserver("qianghua", _loc_1);
            this.qianghuaView.selectBox.alpha = 0;
            closBtn.addEventListener(MouseEvent.CLICK, this.closeHandler);
            this.viewArr = [this.qianghuaView, this.jiandingView, this.daoju_hechengView, this.zhuanyiView];
            this.updateLevel();
            var _loc_2:int = 1;
            while (_loc_2 <= 5)
            {
                
                this["btn" + _loc_2].clickHandler = new Handler(this.changePage, [_loc_2]);
                _loc_2++;
            }
            btn2.visible = false;
            lb_2.visible = false;
            btn4.visible = false;
            lb_4.visible = false;
            this.qianghuaView.qhtab.selectHandler = new Handler(this.tabHandler, [1]);
            this.qianghuaView.mlist.selectHandler = new Handler(this.listSelectHandler1);
            this.qianghuaView.item1.addEventListener(MouseEvent.CLICK, this.clearQh);
            this.qianghuaView.item2.addEventListener(MouseEvent.CLICK, this.clearQh);
            this.qianghuaView.leftBtn.addEventListener(MouseEvent.CLICK, this.zyLeftHandler);
            this.qianghuaView.rightBtn.addEventListener(MouseEvent.CLICK, this.zyRightHandler);
            this.zhuanyiView.item1.addEventListener(MouseEvent.CLICK, this.clearQh);
            this.zhuanyiView.item2.addEventListener(MouseEvent.CLICK, this.clearQh);
            this.zhuanyiView.leftBtn.addEventListener(MouseEvent.CLICK, this.zyLeftHandler);
            this.zhuanyiView.rightBtn.addEventListener(MouseEvent.CLICK, this.zyRightHandler);
            this.zhuanyiView.tab.selectHandler = new Handler(this.tabHandler, [2]);
            this.zhuanyiView.list.selectHandler = new Handler(this.listSelectHandler);
            return;
        }// end function

        public function updateLevel() : void
        {
            var _loc_1:* = UserData.getUserData();
            var _loc_2:* = _loc_1.rein;
            var _loc_3:* = _loc_1.level;
            if (_loc_3 >= 40)
            {
                btn5.visible = true;
                lb_5.visible = true;
            }
            else
            {
                btn5.visible = false;
                lb_5.visible = false;
            }
            if (_loc_3 >= 85)
            {
                btn3.visible = true;
                lb_3.visible = true;
            }
            else
            {
                btn3.visible = false;
                lb_3.visible = false;
            }
            return;
        }// end function

        public function openRefresh(param1:Object) : void
        {
            if (param1)
            {
                this.changePage(int(param1));
            }
            this.zyPage = 1;
            this.updateLevel();
            this.qianghuaView.mcCompletefunc();
            return;
        }// end function

        private function changePage(param1:int) : void
        {
            var _loc_2:* = PluginManager.instance.checkOpenLevel("skill", param1);
            if (_loc_2)
            {
                PluginManager.instance.limitError(_loc_2);
                return;
            }
            if (GuideView.getInstance().gid == GuideType.GUIDE_QH12 || GuideView.getInstance().gid == GuideType.GUIDE_QH2 || GuideView.getInstance().gid == GuideType.GUIDE_QH1 || GuideView.getInstance().gid == GuideType.GUIDE_QH || GuideView.getInstance().gid == GuideType.GUIDE_HC || GuideView.getInstance().gid == GuideType.GUIDE_HC1 || GuideView.getInstance().gid == GuideType.GUIDE_HC2 || GuideView.getInstance().gid == GuideType.GUIDE_HC12)
            {
                GuideView.getInstance().hide(false);
            }
            var _loc_3:* = ModelProxy.getValue("data", "qhflag");
            if (_loc_3)
            {
                ModelProxy.change("movetips", "error", "强化中不能操作");
                return;
            }
            var _loc_4:int = 1;
            while (_loc_4 <= 5)
            {
                
                this["btn" + _loc_4].selected = false;
                this["lb_" + _loc_4].color = "0x9c7d5a";
                if (this.viewArr[(_loc_4 - 1)])
                {
                    this.viewArr[(_loc_4 - 1)].visible = false;
                }
                _loc_4++;
            }
            this["btn" + param1].selected = true;
            this["lb_" + param1].color = "0xb9774b";
            this.qianghuaView.clear();
            this.zhuanyiView.clear();
            if (param1 == 1)
            {
                this.guideFlag = true;
                this.zyPage = 1;
                var _loc_5:int = 0;
                this.beibaoPage = 0;
                this.chuanPage = _loc_5;
                this.qianghuaView.visible = true;
                this.qianghuaView.qhtab.selectedIndex = 0;
                this.qianghuaView.jdtw.visible = false;
                this.qianghuaView.rightBtn.disabled = false;
                this.updateArm();
                this.qianghuaView.mlist.selectedIndex = 0;
            }
            else if (param1 == 2)
            {
                this.jiandingView.visible = true;
                this.jiandingView.jdtab.selectedIndex = 0;
                this.jiandingView.jditemClickHandler(null);
                this.jiandingView.updateArm();
            }
            else if (param1 == 3)
            {
                this.daoju_hechengView.visible = true;
                this.HC_TypeIndex = 2;
                this.show(3);
            }
            else if (param1 == 4)
            {
            }
            else if (param1 == 5)
            {
                this.zyPage = 1;
                this.zhuanyiView.selectBox.visible = false;
                var _loc_5:int = 0;
                this.beibaoPage = 0;
                this.chuanPage = _loc_5;
                this.zhuanyiView.visible = true;
                this.zhuanyiView.tab.selectedIndex = 0;
                this.updateArm();
            }
            this.curPage = param1;
            return;
        }// end function

        public function updateArm() : void
        {
            var _loc_5:Object = null;
            if (this.visible == false)
            {
                return;
            }
            var _loc_1:* = UserData.getBagData();
            if (this._armArray == null)
            {
                return;
            }
            this._armArray.splice(0, this._armArray.length);
            this._armOnArray.splice(0, this._armOnArray.length);
            var _loc_2:* = _loc_1.maxcount;
            var _loc_3:int = 1;
            while (_loc_3 <= _loc_2)
            {
                
                _loc_5 = _loc_1[_loc_3];
                if (_loc_5 && _loc_5[2] == 1)
                {
                    if (_loc_5[4] && _loc_5[4].cls > 0 && _loc_5[4].cls < 10)
                    {
                        this._armArray.push(_loc_5[4]);
                    }
                }
                _loc_3++;
            }
            var _loc_4:* = ModelProxy.getValue("data", "arms");
            _loc_3 = 1;
            while (_loc_3 <= 15)
            {
                
                if (_loc_4[_loc_3] && _loc_4[_loc_3].cls < 10)
                {
                    this._armOnArray.push(_loc_4[_loc_3]);
                }
                _loc_3++;
            }
            if (this.zhuanyiView.visible)
            {
                this.changeData(5, this.objValue);
            }
            if (this.qianghuaView && this.qianghuaView.visible)
            {
                this.changeData(1, this.objValue);
            }
            return;
        }// end function

        public function show(param1:int = 0) : void
        {
            this.mType = param1;
            if (this.mType == 3)
            {
                if (this.daoju_hechengView && this.daoju_hechengView.visible)
                {
                    this.objValue = null;
                    this.showBag();
                    return;
                }
                this.showBag();
            }
            return;
        }// end function

        private function zyLeftHandler(event:MouseEvent) : void
        {
            var _loc_2:String = this;
            var _loc_3:* = this.zyPage - 1;
            _loc_2.zyPage = _loc_3;
            this.qianghuaView.selectBox.alpha = 0;
            this.zhuanyiView.selectBox.alpha = 0;
            if (this.zyPage < 1)
            {
                this.zyPage = 1;
            }
            this.qianghuaView.rightBtn.disabled = false;
            this.zhuanyiView.rightBtn.disabled = false;
            this.renderlist();
            return;
        }// end function

        private function zyRightHandler(event:MouseEvent) : void
        {
            var _loc_2:String = this;
            var _loc_3:* = this.zyPage + 1;
            _loc_2.zyPage = _loc_3;
            this.qianghuaView.selectBox.alpha = 0;
            this.zhuanyiView.selectBox.alpha = 0;
            if (event.currentTarget == this.qianghuaView.rightBtn)
            {
                if (this.qianghuaView.qhtab.selectedIndex == 0)
                {
                    if (this.zyPage >= this.chuanPage)
                    {
                        this.zyPage = this.chuanPage;
                        this.qianghuaView.rightBtn.disabled = true;
                    }
                    else
                    {
                        this.qianghuaView.rightBtn.disabled = false;
                    }
                }
                else if (this.zyPage >= this.beibaoPage)
                {
                    this.zyPage = this.beibaoPage;
                    this.qianghuaView.rightBtn.disabled = true;
                }
                else
                {
                    this.qianghuaView.rightBtn.disabled = false;
                }
            }
            else if (event.currentTarget == this.zhuanyiView.rightBtn)
            {
                if (this.zhuanyiView.tab.selectedIndex == 0)
                {
                    if (this.zyPage >= this.chuanPage)
                    {
                        this.zyPage = this.chuanPage;
                        this.zhuanyiView.rightBtn.disabled = true;
                    }
                    else
                    {
                        this.zhuanyiView.rightBtn.disabled = false;
                    }
                }
                else if (this.zyPage >= this.beibaoPage)
                {
                    this.zyPage = this.beibaoPage;
                    this.zhuanyiView.rightBtn.disabled = true;
                }
                else
                {
                    this.zhuanyiView.rightBtn.disabled = false;
                }
            }
            this.renderlist();
            return;
        }// end function

        private function tabHandler(param1:int, param2:int) : void
        {
            this.zyPage = 1;
            this.qianghuaView.selectBox.visible = false;
            this.qianghuaView.selectBox.alpha = 0;
            this.zhuanyiView.selectBox.visible = false;
            this.zhuanyiView.selectBox.alpha = 0;
            if (param2 == 1)
            {
                if (this.qianghuaView.qhtab.selectedIndex == 1)
                {
                    this.qianghuaView.mlist.selectedIndex = -1;
                    this.qianghuaView.pageLabel.text = String(this.zyPage) + "/" + String(this.beibaoPage);
                }
                else
                {
                    this.qianghuaView.pageLabel.text = String(this.zyPage) + "/" + String(this.chuanPage);
                }
            }
            else if (this.zhuanyiView.tab.selectedIndex == 1)
            {
                this.zhuanyiView.pageLabel.text = String(this.zyPage) + "/" + String(this.beibaoPage);
            }
            else
            {
                this.zhuanyiView.pageLabel.text = String(this.zyPage) + "/" + String(this.chuanPage);
            }
            this.qianghuaView.rightBtn.disabled = false;
            this.zhuanyiView.rightBtn.disabled = false;
            this.renderlist();
            return;
        }// end function

        private function listSelectHandler1(param1:int) : void
        {
            ModelProxy.change("guide", "hide", GuideType.GUIDE_QH);
            ModelProxy.change("guide", "hide", GuideType.GUIDE_QH2);
            if (this.qianghuaView.mlist.selectedItem)
            {
                this.itemClick(this.qianghuaView.mlist.selectedItem);
            }
            return;
        }// end function

        private function listSelectHandler(param1:int) : void
        {
            this.itemClick(this.zhuanyiView.list.selectedItem);
            return;
        }// end function

        public function itemClick(param1:Object) : void
        {
            var _loc_3:Boolean = false;
            if (param1 == null)
            {
                if (this.qianghuaView.visible)
                {
                    this.qianghuaView.clear();
                }
                return;
            }
            var _loc_2:* = UserData.getOnlineData("guide");
            if (int(_loc_2[GuideType.GUIDE_QHO]) == 1 && int(_loc_2[(GuideType.GUIDE_QH1 + 1)]) != 1)
            {
                GuideView.getInstance().doGuide(GuideType.GUIDE_QH1);
            }
            else if (int(_loc_2[GuideType.GUIDE_QHO2]) == 1 && int(_loc_2[(GuideType.GUIDE_QH12 + 1)]) != 1)
            {
                GuideView.getInstance().doGuide(GuideType.GUIDE_QH12);
            }
            if (this.zhuanyiView.visible)
            {
                _loc_3 = false;
                if (this.zhuanyiView.tab.selectedIndex == 0)
                {
                    _loc_3 = true;
                }
                this.zhuanyiView.showItem(param1, _loc_3);
            }
            else if (this.qianghuaView.visible)
            {
                this.qianghuaView.showItem(param1);
            }
            if (this.qianghuaView.visible)
            {
                this.qianghuaView.selectBox.visible = true;
                if (this.isChange || this.isChangeBag)
                {
                    this.qianghuaView.selectBox.alpha = 0;
                    this.tweenComp(36 + this.qianghuaView.mlist.selectedIndex * 62, 1);
                }
                else
                {
                    this.qianghuaView.selectBox.alpha = 0;
                    this.tweenComp(36 + this.qianghuaView.mlist.selectedIndex * 62, 1);
                }
            }
            else
            {
                this.zhuanyiView.selectBox.alpha = 0;
                if (this.zhuanyiView.list.selectedIndex < 0)
                {
                    this.zhuanyiView.selectBox.visible = false;
                }
                else
                {
                    this.zhuanyiView.selectBox.visible = true;
                }
                this.tweenComp(36 + this.zhuanyiView.list.selectedIndex * 62, 2);
            }
            this.qianghuaView.mlist.selectedIndex = -1;
            this.zhuanyiView.list.selectedIndex = -1;
            return;
        }// end function

        public function tweenComp(param1:int, param2:int) : void
        {
            if (param2 == 1)
            {
                this.qianghuaView.selectBox.y = param1;
                this.qianghuaView.selectBox.alpha = 1;
            }
            else
            {
                this.zhuanyiView.selectBox.alpha = 1;
                this.zhuanyiView.selectBox.y = param1;
            }
            return;
        }// end function

        private function renderlist() : void
        {
            var _loc_1:Array = [];
            var _loc_2:Array = [];
            var _loc_3:int = 0;
            while (_loc_3 < this.arr.length)
            {
                
                if (int(_loc_3 / 6) == (this.zyPage - 1))
                {
                    _loc_2.push(this.arr[_loc_3]);
                }
                _loc_3++;
            }
            this.beibaoPage = Math.ceil(this.arr.length / 6) == 0 ? (1) : (Math.ceil(this.arr.length / 6));
            var _loc_4:int = 0;
            while (_loc_4 < this.onArr.length)
            {
                
                if (int(_loc_4 / 6) == (this.zyPage - 1))
                {
                    _loc_1.push(this.onArr[_loc_4]);
                }
                _loc_4++;
            }
            this.chuanPage = Math.ceil(this.onArr.length / 6) == 0 ? (1) : (Math.ceil(this.onArr.length / 6));
            if (this.zhuanyiView.tab.selectedIndex == 0)
            {
                this.zhuanyiView.pageLabel.text = String(this.zyPage) + "/" + String(this.chuanPage);
            }
            else
            {
                this.zhuanyiView.pageLabel.text = String(this.zyPage) + "/" + String(this.beibaoPage);
            }
            if (this.qianghuaView.qhtab.selectedIndex == 0)
            {
                this.qianghuaView.pageLabel.text = String(this.zyPage) + "/" + String(this.chuanPage);
            }
            else
            {
                this.qianghuaView.pageLabel.text = String(this.zyPage) + "/" + String(this.beibaoPage);
            }
            if (this.zhuanyiView.visible)
            {
                if (this.zhuanyiView.tab.selectedIndex == 1)
                {
                    this.zhuanyiView.list.array = _loc_2;
                }
                else
                {
                    this.zhuanyiView.list.array = _loc_1;
                }
                this.zhuanyiView.list.renderHandler = new Handler(this.listlistRender);
            }
            else if (this.qianghuaView.visible)
            {
                if (this.qianghuaView.qhtab.selectedIndex == 1)
                {
                    this.qianghuaView.mlist.array = _loc_2;
                    if (this.oldBeibao.length > 0 && this.oldBeibao.length != _loc_2.length)
                    {
                        this.isChangeBag = true;
                        this.qianghuaView.mlist.selectedIndex = 0;
                        if (_loc_2.length == 0)
                        {
                            this.qianghuaView.showItem(null);
                        }
                    }
                }
                else
                {
                    this.qianghuaView.mlist.array = _loc_1;
                    if (this.oldChuan.length > 0 && this.oldChuan.length != this.onArr.length)
                    {
                        this.isChange = true;
                        this.qianghuaView.mlist.selectedIndex = 0;
                        if (this.onArr.length == 0)
                        {
                            this.qianghuaView.showItem(null);
                        }
                    }
                }
                this.qianghuaView.mlist.renderHandler = new Handler(this.listlistRender2);
            }
            this.oldChuan = this.onArr;
            this.oldBeibao = _loc_2;
            return;
        }// end function

        private function listlistRender2(param1:Component, param2:int) : void
        {
            var _loc_3:Object = null;
            var _loc_4:FlashItem = null;
            var _loc_5:Label = null;
            if (param2 < this.qianghuaView.mlist.array.length)
            {
                _loc_3 = this.qianghuaView.mlist.array[param2];
                _loc_4 = param1.getChildByName("fi") as FlashItem;
                _loc_4.data = _loc_3;
                _loc_5 = param1.getChildByName("nameLabel") as Label;
                _loc_5.isHtml = true;
                _loc_5.text = "<font color=\'" + MColor.getqualitycolor(_loc_3.quality) + "\'>" + _loc_3.name + "</font>";
            }
            return;
        }// end function

        private function listlistRender(param1:Component, param2:int) : void
        {
            var _loc_3:Object = null;
            var _loc_4:FlashItem = null;
            var _loc_5:Label = null;
            if (param2 < this.zhuanyiView.list.array.length)
            {
                _loc_3 = this.zhuanyiView.list.array[param2];
                _loc_4 = param1.getChildByName("fi") as FlashItem;
                _loc_4.data = _loc_3;
                _loc_5 = param1.getChildByName("nameLabel") as Label;
                _loc_5.isHtml = true;
                _loc_5.text = "<font color=\'" + MColor.getqualitycolor(_loc_3.quality) + "\'>" + _loc_3.name + "</font>";
            }
            return;
        }// end function

        public function changeData(param1:int, param2:Object = null) : void
        {
            var _loc_3:Object = null;
            var _loc_4:Object = null;
            var _loc_5:int = 0;
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:Object = null;
            var _loc_9:int = 0;
            this.dataType = param1;
            this.objValue = param2;
            if (param2)
            {
                this.dataLv = param2.level;
            }
            this.arr = [];
            this.onArr = [];
            for each (_loc_3 in this._armArray)
            {
                
                if (param2 != null)
                {
                    if (_loc_3.id == param2.id)
                    {
                        continue;
                    }
                }
                if (param1 == 1)
                {
                    if (_loc_3.level >= 40 && int(_loc_3.superlevel < _loc_3.qhmax))
                    {
                        this.arr.push(_loc_3);
                    }
                    continue;
                }
                if (param1 == 5)
                {
                    _loc_5 = 0;
                    if (_loc_3.level >= 40)
                    {
                        if (this.zhuanyiView.item1.data == null || this.zhuanyiView.item1.data.icon == "")
                        {
                            if (int(_loc_3.superlevel) >= 1 || _loc_3.luck > 1)
                            {
                                this.arr.push(_loc_3);
                            }
                            continue;
                        }
                        if (int(_loc_3.superlevel) == 0 && _loc_5 <= 0)
                        {
                            this.arr.push(_loc_3);
                        }
                    }
                }
            }
            for each (_loc_4 in this._armOnArray)
            {
                
                if (param2 != null)
                {
                    if (_loc_4.id == param2.id)
                    {
                        continue;
                    }
                }
                if (param1 == 1)
                {
                    if (_loc_4.level >= 40 && int(_loc_4.superlevel < _loc_4.qhmax))
                    {
                        this.onArr.push(_loc_4);
                    }
                    continue;
                }
                if (param1 == 5)
                {
                    if (_loc_4.level >= 40)
                    {
                        if (this.zhuanyiView.item1.data == null || this.zhuanyiView.item1.data.icon == "")
                        {
                            if (int(_loc_4.superlevel) >= 1)
                            {
                                this.onArr.push(_loc_4);
                            }
                            continue;
                        }
                        if (int(_loc_4.superlevel) == 0)
                        {
                            this.onArr.push(_loc_4);
                        }
                    }
                }
            }
            if (param1 == 31)
            {
                _loc_6 = UserData.getBagData();
                for (_loc_7 in _loc_6)
                {
                    
                    _loc_8 = ItemObject.create(_loc_6[_loc_7]);
                    if (_loc_8.hasOwnProperty("4"))
                    {
                        if (_loc_8[2] == 2)
                        {
                            _loc_9 = _loc_8[1];
                            _loc_8 = _loc_8[4];
                            if (_loc_8 != null && _loc_8.hasOwnProperty("itemid"))
                            {
                                if (_loc_8.cls == 14)
                                {
                                    _loc_8.count = _loc_9;
                                    this.arr.push(_loc_8);
                                }
                            }
                        }
                    }
                }
                this.curPage = 1;
            }
            if (this.curPage == 1)
            {
                this.arr.sortOn("cls");
            }
            else
            {
                this.onArr.sortOn("cls");
            }
            this.renderlist();
            return;
        }// end function

        private function showBag() : void
        {
            var _loc_1:int = 0;
            if (this.qianghuaView && this.qianghuaView.visible)
            {
                _loc_1 = 1;
            }
            else if (this.zhuanyiView && this.zhuanyiView.visible)
            {
                _loc_1 = 5;
            }
            this.changeData(_loc_1);
            return;
        }// end function

        public function clearDate() : void
        {
            switch(this.mType)
            {
                case 3:
                {
                    this.zhuanyiView.clear();
                    break;
                }
                default:
                {
                    break;
                }
            }
            this.showBag();
            return;
        }// end function

        public function initPanelShow() : void
        {
            ModelProxy.change("tips", "state", "close");
            this.updateArm();
            return;
        }// end function

        private function clearQh(event:MouseEvent) : void
        {
            ModelProxy.change("tips", "state", "close");
            this.updateArm();
            return;
        }// end function

        private function closeHandler(event:MouseEvent) : void
        {
            this.close();
            return;
        }// end function

        private function close() : void
        {
            if (this._close != null)
            {
                this._close();
            }
            this.qianghuaView.clearEffect();
            return;
        }// end function

    }
}
